# coding:utf-8
filename = 'alice.txt'
try:
    with open(filename,encoding='utf-8') as f:
        contents = f.read()
except FileNotFoundError:
    print(f"对不起,文件{filename}不存在")
else:
    words = contents.split()
    num_words = len(words)
    print(f"The title {filename} has about {num_words} words")